package day04;

public class WhileDemo {
    public static void main(String[] args) {
        int times = 0;
        while (times<5){
            System.out.println("行动是成功的阶梯!");
            times++;
        }
        /*
        推导：
        times为0时,打印1次
        times为1时,打印2次
        times为2时,打印3次
        times为3时,打印4次
        times为4时,打印5次
        times为5时,程序结束
         */

        int num = 1;
        while (num<=9) {
            System.out.println(num + "*9=" + num * 9);
            num++;
        }
        int b = 1;
        while (b<=9) {
            System.out.println(b + "*9=" + b * 9);
            b += 2;
        }
    }
}
